# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=noise-repellent
pkgver=0.2.3
pkgrel=2
pkgdesc="An lv2 plug-in for broadband noise reduction"
arch=(loong64 x86_64)
url="https://github.com/lucianodato/noise-repellent"
license=(LGPL3)
groups=(
  lv2-plugins
  pro-audio
)
depends=(
  glibc
  libspecbleach
  lv2-host
)
makedepends=(
  lv2
  meson
)
checkdepends=(lv2lint)
source=($url/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
sha512sums=('102000459c1d2675c7366c4e2ce43fe8a5b055bcb4cbb5460e2e1241a4631bf3833f8d35fb1e07f03759ede0224541c7b3196452649366924c6fad6cccdccf17')
b2sums=('63cf97980926856add1736c86bf064594266bd2fd82b5435114afb49dbe0ff5158478e7e02e66a913ba6e89cb707caee0c3c288e6fd20344f5078f528727836a')

build() {
  arch-meson build $pkgname-$pkgver
  meson compile -C build
}

check() {
  local _links=(
    "https://github.com/lucianodato/noise-repellent#new"
    "https://github.com/lucianodato/noise-repellent-stereo#new"
  )
  for _link in "${_links[@]}"; do
    lv2lint -Mpack -I build/ "${_link}"
  done
}

package() {
  depends+=(
    libspecbleach libspecbleach.so
  )

  meson install -C build --destdir="$pkgdir"
  install -vDm 644 $pkgname-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
